package com.lab.base.common;

import java.io.Serializable;

public class AjaxResult implements Serializable {
    public static final  Integer AJAX_STATUS_CODE_ERROR=0;
    public static final  Integer AJAX_STATUS_CODE_SUCCESS=1;
    public static final  Integer AJAX_STATUS_CODE_WARN=2;

    public static final  Long serialVersionUID=1L;

    private Integer statusCode;

    private String message;

    public AjaxResult() {
        super();
    }

    public static   AjaxResult success(){
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setStatusCode(AjaxResult.AJAX_STATUS_CODE_SUCCESS);
        ajaxResult.setMessage("操作成功");
        return ajaxResult;
    }
    public static   AjaxResult error(){
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setStatusCode(AjaxResult.AJAX_STATUS_CODE_ERROR);
        return ajaxResult;
    }
    public static   AjaxResult warn(){
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setStatusCode(AjaxResult.AJAX_STATUS_CODE_WARN);
        return ajaxResult;
    }


    public Integer getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Integer statusCode) {
        this.statusCode = statusCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
